home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Internet Surfer: Getting Started
/
Internet Surfer - Getting Started (Wayzata Technology)(7231)(1995).bin
/
pc
/
mac
/
bonus
/
peter_le
/
finger_1
/
tokens
/
timeon.p
< prev
Wrap
Text File
|
1991-11-14
|
980b
|
46 lines
unit TIMEON;
interface
uses
ParameterDef;
procedure Main (var p: parameterRecord);
implementation
procedure Main (var p: parameterRecord);
procedure MyTimeString (secs: longInt; withsecs: boolean; var s: str255);
function mts (units, count: longInt; pair: boolean): str255;
var
t: longInt;
s: str255;
begin
t := secs div units mod count;
NumToString(t, s);
if pair then
if length(s) < 2 then
s := concat('0', s);
mts := s;
end;
begin
s := concat(mts(3600, 24, false), ':', mts(60, 60, true));
if secs > 86400 then
s := concat(mts(86400, 10000, false), 'd ', s);
if withsecs then
s := concat(s, ':', mts(1, 60, true));
end;
var
t: longInt;
begin
t := TickCount div 60;
UprString(p.param^, false);
if p.param^ = 'TIMESEC' then
MyTimeString(t, true, p.returnValue^)
else if p.param^ = 'TIME' then
MyTimeString(t, false, p.returnValue^)
else
p.returnValue^ := '?';
end;
end.